package com.example.zxq_server.whbgy.adpterpack;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.administrator.idocment.docment.DocFind;
import com.example.administrator.idocment.msgpack.modelpack.DocModel;
import com.example.zxq_server.whbgy.R;
import com.example.zxq_server.whbgy.sppack.IPhoneFile;
import com.example.zxq_server.whbgy.sppack.SpImp;

import java.util.List;

/**
 * Created by zxq_Server on 2017/9/9.
 */
public class ExcelFileAdapter extends BaseQuickAdapter<DocModel,BaseViewHolder> {

    private Context context;

    public ExcelFileAdapter(List<DocModel> data,Context context) {
        super(R.layout.item_file,data);
        this.context=context;
    }


    private IExcelCallBack iExcelCallBack;

    public void setiExcelCallBack(IExcelCallBack iExcelCallBack) {
        this.iExcelCallBack = iExcelCallBack;
    }

    @Override
    protected void convert(final BaseViewHolder helper, final DocModel item) {
        helper.setText(R.id.file_name,item.getTitle());
        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(iExcelCallBack!=null)
                    iExcelCallBack.excelPath(item.getPath());
            }
        });

    }



}
